﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;

namespace kb.net
{
    public class Encryption
    {
        private Encryption() { }

        public static String Encrypt(String input)
        {
            SHA512Managed algorithm = new SHA512Managed();
            return Encryption.ToString(algorithm.ComputeHash(Encryption.ToByteArray(input)));
        }

        private static Byte[] ToByteArray(String input)
        {
            return Encoding.Default.GetBytes(input);
        }

        private static String ToString(Byte[] input)
        {
            return Encoding.Default.GetString(input);
        }
    }
}
